package logic

import (
	"context"
	"kill/common/proto/goods"
	"kill/service/server"
	"log"
)

type ServerGoods struct {
	goods.UnimplementedGoodsServer
}

func (s ServerGoods) AddKill(ctx context.Context, in *goods.AddKillReq) (*goods.AddKillResp, error) {
	kill, err := server.AddKill(in)
	if err != nil {
		return nil, err
	}
	return kill, nil
}
func (s ServerGoods) EsToKill(ctx context.Context, in *goods.EsToKillReq) (*goods.EsToKillResp, error) {
	kill, err := server.EsToKill(in)
	if err != nil {
		return nil, err
	}
	return kill, nil
}
func (s ServerGoods) KillSearch(ctx context.Context, in *goods.KillSearchReq) (*goods.KillSearchResp, error) {
	search, err := server.KillSearch(in)
	if err != nil {
		return nil, err
	}
	return search, nil
}
func (s ServerGoods) Register(ctx context.Context, in *goods.RegisterReq) (*goods.RegisterResp, error) {
	register, err := server.Register(in)
	if err != nil {
		return nil, err
	}
	return register, nil
}
func (s ServerGoods) Login(ctx context.Context, in *goods.LoginReq) (*goods.LoginResp, error) {
	login, err := server.Login(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}
func (s ServerGoods) RealName(ctx context.Context, in *goods.RealNameReq) (*goods.RealNameResp, error) {
	name, err := server.RealName(in)
	if err != nil {
		return nil, err
	}
	return name, nil
}
func (s ServerGoods) CreateOrder(ctx context.Context, in *goods.CreateOrderReq) (*goods.CreateOrderResp, error) {
	order, err := server.CreateOrder(in)
	if err != nil {
		log.Println(err)
		return nil, err
	}
	return order, nil
}
func (s ServerGoods) AliPay(ctx context.Context, in *goods.AliPayReq) (*goods.AliPayResp, error) {
	pay, err := server.AliPay(in)
	if err != nil {
		return nil, err
	}
	return pay, nil
}
